﻿<controls:ChildWindow x:Class="Silverlight.Navigation.Controls.Favorites"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
           Width="400" Height="300" 
           Title="Favorites">
    
    <controls:ChildWindow.Resources>
        <DataTemplate x:Key="ListBoxItemTemplate">
            <Grid Width="Auto">
                <Grid.RowDefinitions>
                    <RowDefinition />
                </Grid.RowDefinitions>
                
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="300" />
                    <ColumnDefinition Width="70" />
                </Grid.ColumnDefinitions>
                
                <HyperlinkButton Content="{Binding Path=Name}" ToolTipService.ToolTip="{Binding Path=Uri}" Click="HyperlinkButton_Click" Grid.Row="0" Grid.Column="0" VerticalAlignment="Center"/>
                <Button Content="Delete" HorizontalAlignment="Right" Click="DeleteButton_Click" Grid.Row="0" Grid.Column="1" VerticalAlignment="Center"></Button>
            </Grid>
        </DataTemplate>
    </controls:ChildWindow.Resources>
    
    <Grid x:Name="LayoutRoot" Margin="2">
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <ListBox x:Name="FavoritesListBox" ItemTemplate="{StaticResource ListBoxItemTemplate}" Grid.Row="0"></ListBox>
        <Button x:Name="CloseButton" Content="Close" Click="CloseButton_Click" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,12,0,0" Grid.Row="1" />
    </Grid>
</controls:ChildWindow>